Fix a leak in the font chooser widget
authorMatthias Clasen <mclasen@redhat.com>
Sun, 23 Aug 2020 15:59:41 +0000 (11:59 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 23 Aug 2020 20:45:15 +0000 (16:45 -0400)
Contrary to what you may expect, pango_attr_font_desc_new()
is not transfer full, it makes a copy of the font description.

gtk/gtkfontchooserwidget.c

index 6463a66520baa8e2341e1f3117587e3446182d89..480cd88d54b6c1097658ff0a20056b58ac5c39e6 100644 (file)
@@ -505,6 +505,7 @@ get_font_attributes (GObject  *ignore,
       font_desc = pango_font_face_describe (face);
       attribute = pango_attr_font_desc_new (font_desc);
       pango_attr_list_insert (attrs, attribute);
+      pango_font_description_free (font_desc);
     }
 
   return attrs;